package com.eig.orderweb.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.eig.common.entity.order.TOrder;
import com.eig.common.entity.order.TPayLog;
import com.eig.common.vo.order.OrderLog;
import com.eig.orderweb.dao.TOrderDao;
import com.eig.orderweb.service.TOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 订单(TOrder)表服务实现类
 *
 * @author makejava
 * @since 2022-12-07 18:43:30
 */
@Service("tOrderService")
public class TOrderServiceImpl implements TOrderService {
    @Resource
    private TOrderDao tOrderDao;



    @Override
    public Map getAllOrder(Integer currentPage, Integer pageSize,String mobile) {
        Map map = new HashMap<String, Object>();
        QueryWrapper<TOrder> wrapper = new QueryWrapper<>();
        wrapper.eq("mobile",mobile);
        Long aLong = tOrderDao.selectCount(wrapper);
        wrapper.last("limit "+(currentPage-1)*pageSize+","+pageSize);
        List<TOrder> tOrders = tOrderDao.selectList(wrapper);
        map.put("allOrder",tOrders);
        map.put("total",aLong);
        return map;
    }


}
